home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / C / Mesa / mklib.freebsd < prev    next >
Encoding:
Text File  |  1997-01-07  |  444 b   |  26 lines

  1. #!/bin/sh
  2.  
  3. # Make a FreeBSD shared library
  4. # contributed by Mark Diekhans <markd@grizzly.com>
  5.  
  6. # First argument is name of output library
  7. # Rest of arguments are object files
  8.  
  9. VERSION="2.2"
  10.  
  11. LIBRARY=$1
  12. shift 1
  13. OBJECTS=$*
  14.  
  15. BASENAME=`echo ${LIBRARY} | sed "s/\.a//g"`
  16. SHLIB=${BASENAME}.so.${VERSION}
  17. STLIB=${BASENAME}.a
  18.  
  19. rm -f ${SHLIB} ${STLIB}
  20.  
  21. ar cq ${STLIB} ${OBJECTS}
  22. ranlib ${STLIB}
  23. ld -Bshareable -o ${SHLIB} ${OBJECTS}
  24.  
  25. mv ${SHLIB} ../lib
  26.